# Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor: Baris Demirdelen <barisdemirdelen at gmail dot com>
# Contributor: Andrew Anderson <aanderso@tcd.ie>
# Contributor: Jonathon Fernyhough <jonathon_at manjaro_dotorg>
pkgname=intel-dnnl
_pkgname=mkl-dnn
pkgver=1.2.2
pkgrel=1
pkgdesc="Intel Deep Neural Network Library (formerly mkl-dnn)"
arch=(loong64 x86_64)
provides=(mkl-dnn)
url=https://github.com/intel/mkl-dnn
license=('APACHE')
depends=('gcc-libs')
makedepends=('cmake' 'doxygen')
source=("$pkgname-$pkgver.tar.gz::https://github.com/intel/mkl-dnn/archive/v${pkgver}.tar.gz")
sha256sums=('a71ec1f27c30b8a176605e8a78444f1f12301a3c313b70ff93290926c140509c')

prepare() {
  mkdir -p "$_pkgname-$pkgver"/build
}

build() {
  cd "$_pkgname-$pkgver/build"
  cmake .. -DCMAKE_INSTALL_PREFIX="/usr"
  make
  make doc
}

check() {
  cd "$_pkgname-$pkgver/build"
  ctest
}

package() {
  cd "$_pkgname-$pkgver/build"
  DESTDIR="$pkgdir" make install

  install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
